package com.kamistoat.meimeistore.commonlog.utils;

import com.kamistoat.meimeistore.apisystem.domain.SysOperLog;
import com.kamistoat.meimeistore.apisystem.feign.RemoteLogService;
import com.kamistoat.meimeistore.commoncore.constant.SecurityConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * 异步调用日志工具类
 */
@Component
public class AsyncLogService {
    @Autowired
    RemoteLogService remoteLogService;

    /**
     * 保存系统日志
     *
     * @param sysOperLog 操作日志记录表 oper_log 的 vo类
     */
    @Async
    public void saveSysLog(SysOperLog sysOperLog) {
        remoteLogService.saveLog(sysOperLog, SecurityConstants.INNER);
    }
}
